/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.sys.entity;

import org.hibernate.validator.constraints.Length;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

import com.lczyfz.istep.common.persistence.DataEntity;

/**
 * 任务调度JobEntity
 *
 * @author maple
 * @version 2016-12-14
 */
public class ScheduleJob extends DataEntity<ScheduleJob> {

    private static final long serialVersionUID = 1L;
    private String jobName;        // 任务名称
    private String jobGroup;        // 任务分组
    private String beanClass;        // 类的方法（包名+类名）
    private String beanName;        // 任务Bean名称
    private String methodName;        // 任务调用的方法名
    private String cronExpression;        // cron表达式
    private String isFactory;        // 任务创建方式：0：正常创建；1.工厂创建
    private String isConcurrent;        // 任务是否并发
    private String status;        // 任务状态（是否启动任务）：1：启动；0：停止
    private Date startDate;        // 任务开始执行时间
    private Date nextDate;        // 任务下次执行时间
    private String description;        // 任务描述

    public ScheduleJob() {
        super();
    }

    public ScheduleJob(String id) {
        super(id);
    }

    @Length(min = 0, max = 255, message = "job_name长度必须介于 0 和 255 之间")
    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    @Length(min = 0, max = 255, message = "job_group长度必须介于 0 和 255 之间")
    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    @Length(min = 0, max = 255, message = "bean_class长度必须介于 0 和 255 之间")
    public String getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(String beanClass) {
        this.beanClass = beanClass;
    }

    @Length(min = 0, max = 255, message = "bean_name长度必须介于 0 和 255 之间")
    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Length(min = 0, max = 255, message = "method_name长度必须介于 0 和 255 之间")
    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    @Length(min = 0, max = 255, message = "cron_expression长度必须介于 0 和 255 之间")
    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    @Length(min = 0, max = 255, message = "is_factory长度必须介于 0 和 255 之间")
    public String getIsFactory() {
        return isFactory;
    }

    public void setIsFactory(String isFactory) {
        this.isFactory = isFactory;
    }

    @Length(min = 0, max = 255, message = "is_concurrent长度必须介于 0 和 255 之间")
    public String getIsConcurrent() {
        return isConcurrent;
    }

    public void setIsConcurrent(String isConcurrent) {
        this.isConcurrent = isConcurrent;
    }

    @Length(min = 0, max = 255, message = "status长度必须介于 0 和 255 之间")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getNextDate() {
        return nextDate;
    }

    public void setNextDate(Date nextDate) {
        this.nextDate = nextDate;
    }

    @Length(min = 0, max = 255, message = "description长度必须介于 0 和 255 之间")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}